package com.zfs.test.mapper;


import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.jdbc.SQL;


public class XinxiSql {

	public String showAll(@Param("dname") String dname,@Param("s") int s,@Param("e") int e){
		return new SQL(){{
			SELECT("*");
			FROM("xinxi");
			if (null!=dname&&!"".equals(dname)) {
				
				WHERE("dname like concat(#{dname},'%')");
			}
			
		}}.toString().concat(" limit #{s},#{e}");
		
	}
	
	
	public String getCount(String dname){
		return new SQL(){{
			SELECT("count(1)");
			FROM("xinxi");
if (null!=dname&&!"".equals(dname)) {
				
				WHERE("dname like concat(#{dname},'%')");
			}
			
		}}.toString();
		
	}
}
